package testCell;

import static org.junit.Assert.*;

import org.junit.*;
import player.Player;
import cell.GoToHospitalCell;
import cell.HospitalCell;

public class TestHospitalCell {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	// Test method trigger cell
	@Test
	public void testTriggerCell() {
		GoToHospitalCell GTH = new GoToHospitalCell(4);
		Player p = new Player();
		
		GTH.TriggerCell(p);
		
		boolean actual = (p.getGridX() == 6 && p.getGridY() == 5 );
		
		assertTrue(actual);
	}
	
	@Test
	public void testStartHospital_1() {
		Player p1=new Player();
		
		p1.setSEPoint(-2);
		p1.setLocation(10, 14);
		HospitalCell.StartHospital(p1, false);
		
		int result1=p1.getGridX();
		int result2=p1.getGridY();
		int result3=p1.getSEPoint();
		
		assertEquals(10, result1);
		assertEquals(14, result2);
		assertEquals(-1, result3);
	}
	
	@Test
	public void testStartHospital_2() {
		Player p1=new Player();
		
		p1.setSEPoint(5);
		p1.setLocation(10,14);
		HospitalCell.StartHospital(p1, false);
		
		int result1=p1.getGridX();
		int result2=p1.getGridY();
		int result3=p1.getSEPoint();
		
		assertEquals(6, result1);
		assertEquals(5, result2);
		assertEquals(5, result3);
	}

}
